package com.yehun.mapper;

import com.yehun.entity.User;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface UserMapper {

    List<User> list();

    List<User> listByRoleId(@Param("roleId") int roleId);

    User get(@Param("id") int id);

    User getByUserId(@Param("userId") String userId);

    User getByEmail(@Param("email") String email);

    int save(User user);

    int updateRole(@Param("userId") String userId, @Param("roleId") int roleId, @Param("roleName") String roleName);

    int updatePermission(@Param("userId") String userId, @Param("permission") Long permission);

    int remove(@Param("id") int id);

    int removeBatch(@Param("idArray") Integer[] idArray);
}
